<?php
namespace App\Model\CustomGame;

use App\Model\BaseModel;
use Illuminate\Support\Facades\DB;

/**
 * 自定义游戏模型
 */
class CustomGameGift extends BaseModel
{

    /**
     * 互动礼物类型
     */
    const GIFT_TYPE_INTERACT = 1;

    /**
     * 双费礼物类型
     */
    const GIFT_TYPE_DOUBLE = 2;

    protected $table = "custom_game_gift";


    /**
     * 根据条件删除数据
     *
     * @param array $condition
     * @return int|bool
     */
    public function deleteByCondition($condition)
    {
        return DB::connection($this->connection)->table($this->table)
            ->where($condition)
            ->delete();
    }

    /**
     * 批量插入
     *
     * @param array $list
     * @return
     */
    public function batchInsertList(array $list)
    {
        return DB::connection($this->connection)->table($this->table)->insert($list);
    }

}
